
export interface ResourceDetail {
  id: number
  title: string
  name: string
  size: number
  uploadTime: string
  description: string
  rating: number
  downloads: number
}

export interface Resource {
  id: number;
  title: string;
  type: string;
}

export interface ResourcePage {
  total: number;
  pageIndex: number;
  totalPages: number;
  results: Resource[];
}


export interface SearchCondition {
  isSearch: boolean,
  query: string,
  filters: Filters,
  pageIndex: number
}

export type CategoryType = 'null' | 'document' | 'video' | 'voice' | 'software' | 'design' | 'code' | 'mod';
export type TimeType = 'null' | 'week' | 'month' | 'year';
export type SortType = 'null' | 'comprehensive' | 'latest' | 'downloads' | 'rating';

export type Filters = {
  category: CategoryType;
  time: TimeType;
  sort: SortType;
}

// 上传门牌
export interface Doorplate {
  userId: number,
  secondaryPath: string       //用户id下的文件路径
}

export interface UploadResourceChunk{
  userId: number,
  secondaryPath: string,
  chunkTotalNumber: number,
  chunkIndex: number,
  chunk: string
}

export interface UploadResourceInformation {
  userId: number,
  secondaryPath: string,
  title: string,
  name: string,
  size: string,
  type: string,
  description: string
}

